<?php

final class Models_Core_Users_Record extends Core_Data_GenericRecord {

    private $_Key;
    private $_Email;
    private $_InitPassword;

    private $arrValues;
    private $arrUpdateValues;

    function __construct () {
        if ( func_num_args() == 2 ) {
            $Model = func_get_arg(0);
            $arrValues = func_get_arg(1);
            $strPrimaryKey = "Key";
            parent::__construct( $Model, $arrValues, $strPrimaryKey );
        }
    }

    function __get ( $strName ) {

    }

    function __set ( $strName, $mixValue ) {
        $this->arrUpdateValues[$strName] = $mixValue;
    }

    function __isset ( $strName ) {

    }

    function __unset ( $strName ) {

    }

    public function getKey () {
        return $this->get( "Key" );
    }

    public function getEmail () {
        return $this->get( "Email" );
    }

    /**
     * Sets the update value for the field 'Email'.
     *
     * @exception InvalidArgumentException
     * @param string $strEmail
     * @param boolean $boolupdate
     */
    public function setEmail ( $strEmail, $boolUpdate = false ) {
        if ( Core_String::isEmail( $strEmail ) ) {
            $this->set( $this, "Email", $strEmail, $boolUpdate );
        } else {
            throw new InvalidArgumentException( "\$strEmail holds '$strEmail' and is not a valid email.", 0 );
        }
    }

    public function isInitPassword () {
        $this->get( "InitPassword" );
    }

    public function setInitPassword ( $boolInitPassword = true, $boolUpdate = false ) {
        if ( is_bool( $boolInitPassword ) ) {
            $intInitPassword = ( $boolInitPassword ) ? 1 : 0;
            $this->set( $this, "InitPassword", $intInitPassword, $boolUpdate );
        } else {
            throw new InvalidArgumentException( "\$boolInitPassword is not a boolean.", 0 );
        }
    }

}

?>
